package com.gperp.service.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.gperp.mapper.AsFunctionMapper;
import com.gperp.pojo.AsFunction;
import com.gperp.pojo.AsFunctionExample;
import com.gperp.service.FunctionService;

@Service
public class FunctionServiceImpl implements FunctionService {
	
	@Resource
	private AsFunctionMapper functionMapper;
	
	@Override
	public List<AsFunction> queryList() {
		AsFunctionExample example = new AsFunctionExample();
		example.createCriteria().andParentidGreaterThan(0);
		return functionMapper.selectByExample(example);
	}

	@Override
	public List<AsFunction> functionListByIds(String ids) {
		List<Long> idsss = new ArrayList<Long>();
		for (String s : ids.split(",")) {
			idsss.add(Long.parseLong(s));
		}
		AsFunctionExample example = new AsFunctionExample();
		example.createCriteria().andIdNotIn(idsss).andParentidGreaterThan(0);
		return functionMapper.selectByExample(example);
	}
	
}
